package com.lzh.oss.demo.easyexcel;

import com.alibaba.excel.EasyExcel;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName ExcelDemo
 * Description
 * @Author lizihao
 * Date 2020/11/30 11:15
 * @Version 1.0
 **/
public class ExcelDemo {
    public static void main(String[] args) {
        String fileName = "C:\\Users\\Administrator\\Desktop\\文档\\换手率\\换手率.xlsx";

        //EasyExcel.write(fileName,TestData.class).sheet("哈士涛一号").doWrite(data());

        EasyExcel.read(fileName,StockData.class,new ExcelListener()).sheet().doRead();

    }
    private static List<TestData> data() {
        List<TestData> data = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            TestData testData = new TestData();
            testData.setSno(i);
            testData.setSname("哈士涛"+i);
            data.add(testData);
        }
        return data;
    }
}
